﻿using System.Windows.Forms;
using Shape.Mvp.Commands;
using Shape.Mvp.Sample.Presenters;

namespace Shape.Mvp.Sample
{
   public class ApplicationStartCommand : ICommand
   {
      ExerciseListPresenter _presenter;
      IApplicationController _applicationController;

      public ApplicationStartCommand(ExerciseListPresenter presenter, IApplicationController applicationController)
      {
         _presenter = presenter;
         _applicationController = applicationController;
      }

      public void Execute()
      {
         _presenter.Initialise();

         _applicationController.Show(_presenter.View).AsMainWindow();
      }
   }
}
